1. Field of the Invention
This invention relates to writing data and more particularly relates to a read-before-write storage controller instruction.
2. Description of the Related Art
Data storage systems, referred to hereinafter as storage systems, frequently write new data to an address of a storage device. Often the new data overwrites old data previously stored at the address.
Unfortunately, new data may erroneously overwrite valuable old data. To prevent the loss of valuable data, storage systems often employ an undo log. The undo log preserves overwritten data. Thus if an administrator or user determines that the old data has been erroneously overwritten, the old data can be recovered from the undo log.
The undo log is typically a memory device. In one embodiment, the undo log may be configured as addressable memory. Creating and maintaining the undo log typically requires reading the old data from the storage device address and writing the old data to the undo log. The new data may then be written to the storage device address. The process is often referred to as a read-before-write operation. Unfortunately, the read-before-write operation must be explicitly encoded at the application level. This is very costly from a time perspective as it requires the storage controller to interact with the application level three times for each data update to be saved in the undo log.